package com.hzjy.api.service.impl;

import java.util.List;

import com.hzjy.api.beans.HzjyAdvertising;
import com.hzjy.api.mapper.HzjyAdvertisingMapper;
import com.hzjy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 广告位Service业务层处理
 * 
 * @author hzjy
 * @date 2020-09-22
 */
@Service
public class HzjyAdvertisingServiceImpl
{
    @Autowired
    private HzjyAdvertisingMapper hzjyAdvertisingMapper;

    /**
     * 查询广告位
     * 
     * @param id 广告位ID
     * @return 广告位
     */
    public HzjyAdvertising selectHzjyAdvertisingById(Long id)
    {
        return hzjyAdvertisingMapper.selectHzjyAdvertisingById(id);
    }

    /**
     * 查询广告位列表
     * 
     * @param hzjyAdvertising 广告位
     * @return 广告位
     */
    public List<HzjyAdvertising> selectHzjyAdvertisingList(HzjyAdvertising hzjyAdvertising)
    {
        return hzjyAdvertisingMapper.selectHzjyAdvertisingList(hzjyAdvertising);
    }

    /**
     * 新增广告位
     * 
     * @param hzjyAdvertising 广告位
     * @return 结果
     */
    public int insertHzjyAdvertising(HzjyAdvertising hzjyAdvertising)
    {
        hzjyAdvertising.setCreateTime(DateUtils.getNowDate());
        return hzjyAdvertisingMapper.insertHzjyAdvertising(hzjyAdvertising);
    }

    /**
     * 修改广告位
     * 
     * @param hzjyAdvertising 广告位
     * @return 结果
     */
    public int updateHzjyAdvertising(HzjyAdvertising hzjyAdvertising)
    {
        return hzjyAdvertisingMapper.updateHzjyAdvertising(hzjyAdvertising);
    }

    /**
     * 批量删除广告位
     * 
     * @param ids 需要删除的广告位ID
     * @return 结果
     */
    public int deleteHzjyAdvertisingByIds(Long[] ids)
    {
        return hzjyAdvertisingMapper.deleteHzjyAdvertisingByIds(ids);
    }

    /**
     * 删除广告位信息
     * 
     * @param id 广告位ID
     * @return 结果
     */
    public int deleteHzjyAdvertisingById(Long id)
    {
        return hzjyAdvertisingMapper.deleteHzjyAdvertisingById(id);
    }

    public List<HzjyAdvertising> selectAdvertisingList(HzjyAdvertising hzjyAdvertising) {
        return hzjyAdvertisingMapper.selectAdvertisingList(hzjyAdvertising);
    }
}
